import { axios } from '@/utils/request'
import { applyAudit } from '../share'

const api = {
  profitReceiver: '/saas/profit-receiver',
  deleteReceiver: '/saas/delete-receiver',
  getRecord: '/saas/share-profit-record',
  financiaList: '/saas/financia-list',
}

export default api

export function getProfitReceiver(parameter) {
  return axios({
    url: api.profitReceiver,
    method: 'get',
    params: parameter,
  })
}

export function setProfitReceiver(parameter) {
  return axios({
    url: api.profitReceiver,
    method: 'post',
    data: parameter,
  })
}

export function deleteProfitReceiver(parameter) {
  return axios({
    url: api.deleteReceiver,
    method: 'post',
    data: parameter,
  })
}

export function getProfitList(parameter) {
  return axios({
    url: api.getRecord,
    method: 'get',
    params: parameter,
  })
}

export function financiaList(params) {
  return axios({
    url: api.financiaList,
    method: 'get',
    params,
  })
}

export function exportFinanciaList() {
  return process.env.VUE_APP_API_BASE_URL + api.financiaList
}
